package com.itjob.scott.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class UserAspect {
	
	
	public void doBefore(JoinPoint jp){
		System.out.println("前置通知doBefore..." + jp.getSignature().getName());
		
	}
	
	public void doAfter(JoinPoint jp){
		System.out.println("后置通知doAfter...");
		
	}
	
	public void doAround(ProceedingJoinPoint pjp) throws Throwable{
		System.out.println("环绕通知doAround Before...");
		pjp.proceed();
		
		//当目标抛异常的时候下面的语句不会被执行
		System.out.println("环绕通知doAround After...");
		
	}
	
	public void doThrowing(JoinPoint jp,Throwable ex) throws Throwable{
		System.out.println("异常通知doThrowing..." + ex);
	}

}
